package com.yanqu.road.server.cmd.banquet.party;

import com.yanqu.road.pb.banquet.BanquetProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.banquet.BanquetModule;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.manger.banquet.BanquetMgr;
import com.yanqu.road.server.protocol.CrossProtocol;
import com.yanqu.road.server.protocol.Protocol;

import java.math.BigDecimal;

//@Cmd(code = GameProtocol.S_PARTY_REWARD,desc = "")
@Cmd(code = Protocol.S_BANQUET_GET_REWARD, desc = "獲取自己開啟的宴會的獎勵")
public class GetPartyRewardCmd extends AbstractCommand {
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        BanquetProto.CrossPartyGetRewardReqMsg.Builder msg = BanquetProto.CrossPartyGetRewardReqMsg.newBuilder();
        double beautiesSkillAddition = BanquetMgr.getBanquetOpenSkillAddition(player);
        msg.setBeautiesSkillAddition(new BigDecimal(beautiesSkillAddition).toString());
        int normalBanquetNum = player.getModule(BanquetModule.class).getNormalBanquetNum();
        msg.setNormalBanquetNum(normalBanquetNum);
        player.sendPacket(CrossProtocol.C_CROSS_PARTY_GET_REWARD, msg);
    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
